import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type homeResult = {
  page: any;
  result: any
};

/** 分页查询字典 */
export const seldictionarybypage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi(`/secbackend/dictionary/seldictionarybypage`), { data });
};

/** 新增字典 */
export const insertdictionary = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/dictionary/insertdictionary"), { data });
};

/** 删除字典 */
export const deldictionaryr = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/secbackend/dictionary/deldictionaryr/${userid}`));
};

/** 修改字典图 */
export const updatedictionary = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/dictionary/updatedictionary"), { data });
};


/** 根据字典所属类别id查询下级字典分类 */
export const updateauth = (id?: string | number) => {
  return http.request<homeResult>("get", baseUrlApi(`/secbackend/dictionary/selzdbyid/${id}`));
};

/** 获取字典所属类别列表 */
export const getzd = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/secbackend/dictionary/getzd"), { data });
};

